package edu.sctu.zhengsenwen.month201506.day20150623.operator;

/**
 应用操作符进行数字排序
 * Created by user15 on 2015/6/23.
 */
public class Sort {

    public static void main(String[] args) {

        int[] Array = {1996, 1998, 2002, 2003, 1997, 1998, 2002, 2003};

        for (int i = 0; i < Array.length; i++) {
            for (int j = 0; j < i; j++) {
                if (Array[j] > Array[j + 1]) {

                    int temp = Array[j];
                    Array[j] = Array[j + 1];
                    Array[j + 1] = temp;
                }
            }
        }

        for (int i = 0; i < Array.length; i++) {
            System.out.println(Array[i] + " ");
        }
    }
}


